import java.util.ArrayList;
import java.util.List;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: fzykd
 * Date: 2023-05-08
 * Time: 20:28
 */

public class College extends OrganizationComponent{
    //存放的是
    List<OrganizationComponent> list = new ArrayList<>();

    public College(String name, String des) {
        super(name, des);
    }

    @Override
    protected void add(OrganizationComponent organizationComponent) {
        list.add(organizationComponent);
    }

    @Override
    protected void remove(OrganizationComponent organizationComponent) {
        list.remove(organizationComponent);
    }

    @Override
    public String getName() {
        return super.getName();
    }

    @Override
    public String getDes() {
        return super.getDes();
    }

    //输出包含的院校
    @Override
    protected void print() {
        System.out.println("--------------" + getName() + "----------------");
        for (OrganizationComponent organizationComponent : list) {
            organizationComponent.print();
        }

    }
}
